/*
* $Id: UserFieldsTable.h 2 2009-12-23 13:58:02Z volok-aleksej@yandex.ru $
*
* Copyright 2009 by Volokitin Alexey
* All rights reserved
*
*/
#ifndef _USER_FIELDS_TABLE_H_
#define _USER_FIELDS_TABLE_H_

#include "../Table.h"
#include "../Operation.h"

class CUserFieldsTable : public CTable, public CFillContent
{
public:
	CUserFieldsTable();
	virtual ~CUserFieldsTable();
public:
	struct content : public CTable::content{
		enum table{
			DEFAULT = 0,
			POINTS,
			FAMILIES,
			INSPECT
		}s_table;
		std::tstring s_strName;
		enum type{
			STRING = 1,
			INTEGER,
			DOUBLE,
			BOOL
		}s_type;
		void operator = (const content& cnt);
		bool operator == (const content& cnt);
		virtual void Clear();
		virtual void Set(const std::vector<CTableItem>& aContent);
		virtual void Free();
	}m_content;
public:
	virtual void CreateTable(IDatabase* pDatabase);
	virtual void UpdateValue(IDatabase* pDatabase);
	virtual IResult* GetValue(IDatabase* pDatabase);
	virtual void SetValue(IDatabase* pDatabase);
	virtual void DeleteValue(IDatabase* pDatabase);
	virtual IOperation::i_content* CreateContent();
};

#endif/*_USER_FIELDS_TABLE_H_*/